package com.arron.flyweight;

public class Client {
    public static void main(String[] args) {
        //创建工厂
        WebsiteFactory factory =new WebsiteFactory();
        //客户要一个以前新闻形式发布的网站
        Website website1 =factory.getWebsiteCategory("新闻");
        website1.use(new User("Tom"));

        Website website2 =factory.getWebsiteCategory("博客");
        website2.use(new User("Jacky"));

        Website website3 =factory.getWebsiteCategory("博客");
        website3.use(new User("Simth"));

        Website website4 =factory.getWebsiteCategory("博客");
        website4.use(new User("Arron"));

        System.out.println("网站分类共= "+factory.getWebsiteCount());
    }
}
